home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2760 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.1 KB

  1. Path: locutus.rchland.ibm.com!usenet
  2. From: pstaite@vnet.ibm.com
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: overloading []
  5. Date: 19 Jan 1996 16:05:45 GMT
  6. Organization: IBM OS/2 Device Driver Development  Rochester, MN
  7. Message-ID: <4dofgp$oj6@locutus.rchland.ibm.com>
  8. References: <4dgjbl$6i3@news1.goodnet.com> <4dh86s$bfi@locutus.rchland.ibm.com> <4djpt6$p02@clarknet.clark.net>
  9. Reply-To: pstaite@vnet.ibm.com
  10. NNTP-Posting-Host: warpone.rchland.ibm.com
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <4djpt6$p02@clarknet.clark.net>, gusty@clark.net (Harlan Messinger) writes:
  14. >
  15. >Why would you do
  16. >
  17. >    foo& f(* new foo);
  18. >
  19. >followed by a delete instead of just
  20. >
  21. >    foo f;
  22. >
  23. >with f disappearing when it goes out of scope?
  24.  
  25. Because the original poster was dealing with a dynamically created 
  26. (new'd) object foo.  Basically he/she was looking for a way of calling 
  27. operator[] on the dynamic foo instance.  Sure, an auto foo makes more 
  28. sense, unless of course sizeof(foo) is big and your stack small ;-) 
  29. Then you may never want to create an auto foo...
  30.  
  31.  
  32. Phil Staite, team OS/2
  33. internet: pstaite@vnet.ibm.com  internal: pstaite@rchland
  34.  
  35.